package annotation.load;

public class LoaderClass {
    public static void main(String[] args) {
        A a = new A("111");
        System.out.println(a.m);

        /**
         * 1.加载到内存，产生一个描述类的Class对象
         * 2.链接，链接结束后，m为""
         * 3.初始化，优先将static代码合并
         * <clinit>() {
         *     System.out.println("A类静态代码块初始化");
         *     m = "SkyBlue";
         *     m = "CphRed";
         * }
         */
    }
}

class A {

    static {
        System.out.println("A类静态代码块初始化");
        m = "SkyBlue";
    }

    static String m = "CphRed";

    public A(String name) {
        System.out.println("A类的无参构造初始化");
    }

    @Override
    public String toString() {
        return "A{}";
    }
}